/**
 * 提交el-form表单前验证
 * @param  {[type]} formName 表单的ref值
 */
export default function validateSubmit (formName) {
  return new Promise((resolve, reject) => {
    this.$refs[formName].validate((valid) => {
      if (valid) {
        this.$store.commit("app/SET_LOADING_STATE", true)
        resolve(true)
      } else {
        reject()
      }
    })
  })
}
